<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <script>
    // 求两个数的和
    function getSum() {
      let sum1 = +prompt('输入第一个数')
      let sum2 = +prompt('输入第二个数')
      console.log(sum1 + sum2);
    }
    getSum()
  </script>
</body>

</html>